package com.frank.tx;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * @Author: huweifeng
 * @Date: 2022/11/30
 * @Description:
 **/
@Repository
public class TxDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void insertAccount() {
        String sql = "insert into account(`name`,money) values (?,?)";
        String name = UUID.randomUUID().toString().substring(0,5);
        jdbcTemplate.update(sql, name, 1000);
    }

}
